﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>yUtils Test</title>
    <script src="yUtils.js" type="text/javascript"></script>
    <script type="text/javascript">
        //关于 javascript 委托 示例
        function delegate() {
            var ClassA = function () {
                var _color = "red";
                return {
                    getColor: function () {
                        alert("Color: " + _color);
                    },
                    setColor: function (color) {
                        _color = color;
                    }
                };
            };
            var a = new ClassA();
            var d = yUtils.delegate(a, a.setColor);
            d("blue");
            a.getColor();
        }
        function urlget() {
            var url = "yUtilsTest.html?Name='测试'";
            var value = yUtils.url.get(url, 'Name');
            alert(value);
        }
    </script>
</head>
<body>
    <input id="Button1" type="button" value="delegate" onclick="delegate()" />
    <input id="Button2" type="button" value="urlget" onclick="urlget()" />
</body>
</html>
